package com.designMode.factoryMethod;

/**
 * 简单工厂模式
 */
public class SimpleFactory {
    public Product createProduct(int type) {
        switch (type) {
            case 1:
                return new ConcreteProduct1();
            case 2:
                return new ConcreteProduct2();
            default:
                return null;
        }
    }
}
